package jp.ac.u_tokyo.dch.model.db;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.xwork.StringUtils;

import jp.ac.u_tokyo.dch.view.Constants;


public class GroupItems {

	private String groupId;

	private String fieldKeyList;

	private String topFieldKey;

	private String displayName;

	public String getGroupId() {
		return groupId;
	}

	public void setGroupId(String groupId) {
		this.groupId = groupId;
	}

	public String getFieldKeyList() {
		return fieldKeyList;
	}

	public List<String> toFieldKeyList() {

		List<String> list = new ArrayList<String>();
		list.add(topFieldKey);

		if (!StringUtils.isEmpty(fieldKeyList)) {
			for (String field : fieldKeyList.split(Constants.FIELDKEY_DEL)) {
				list.add(field);
			}
		}

		return list;
	}

	public void setFieldKeyList(String fieldKeyList) {
		this.fieldKeyList = fieldKeyList;
	}

	public String getDisplayName() {
		return displayName;
	}

	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}

	public String getTopFieldKey() {
		return topFieldKey;
	}

	public void setTopFieldKey(String topFieldKey) {
		this.topFieldKey = topFieldKey;
	}

}
